import request from '@/utils/request'

// 获取全部用户
export function getCommonUsers(query) {
  return request({
    url: '/commonUsers',
    method: 'GET',
    params: query
  })
}
// 根据id获取用户
export function getUserById(id) {
  return request({
    url: `/commonUser/${id}`,
    method: 'GET'
  })
}
// 根据关键字获取用户
export function getUserByKeyWords(query) {
  return request({
    url: '/commonUsers/keywords',
    method: 'GET',
    params: query
  })
}
// 根据id修改用户状态
export function updateStatus(id, data) {
  return request({
    url: `/commonUser/status/${id}`,
    method: 'PUT',
    data
  })
}
export default {
  getCommonUsers,
  getUserById,
  updateStatus,
  getUserByKeyWords
}